//
//  ViewController.m
//  LMWebViewDemo
//
//  Created by mengmenglu on 5/16/16.
//  Copyright © 2016 Hangzhou TaiXuan Network Technology Co., Ltd. All rights reserved.
//

#import "ViewController.h"
#import "LMShareBaseWebViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.title = @"测试UIWebView";
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    // 添加右侧的分享按钮
    UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeSystem];
    shareButton.frame = CGRectMake(100, 100, 100, 40);
    shareButton.titleLabel.font = [UIFont systemFontOfSize:15];
    [shareButton setTitleColor:[UIColor colorWithRed:52.0/255 green:52.0/255 blue:52.0/255 alpha:1] forState:UIControlStateNormal];
    shareButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    [shareButton addTarget:self action:@selector(shareBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [shareButton setTitle:@"测试分享" forState:UIControlStateNormal];
    
    shareButton.layer.cornerRadius = 6;
    shareButton.layer.borderWidth = 1;
    shareButton.layer.borderColor = [UIColor grayColor].CGColor;
    shareButton.layer.masksToBounds = YES;
   
    [self.view addSubview:shareButton];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark 测试分享
- (void)shareBtnClick {
    
    LMShareBaseWebViewController *shareWebView = [[LMShareBaseWebViewController alloc] init];
    shareWebView.requestURL = @"http://www.baidu.com";
    [self.navigationController pushViewController:shareWebView animated:YES];
}

@end
